//
//  NSDate+Extend.m
//  网易彩票
//
//  Created by Apple on 15/5/30.
//  Copyright (c) 2015年 itcast. All rights reserved.
//

#import "NSDate+Extend.h"

@implementation NSDate (Extend)

+(NSString *)stringFromDate:(NSDate *)date formattor:(NSString *)formattor{
    // 格式时间
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    formatter.dateFormat = formattor;
    return [formatter stringFromDate:date];
}

+(instancetype)dateFromString:(NSString *)dateString formattor:(NSString *)formattor{
    // 格式时间
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    formatter.dateFormat = formattor;
    return [formatter dateFromString:dateString];
}
@end
